Skip to content
main
Switch branches/tags
jam0001/Electrolysis/
jam0001/Electrolysis/

Latest commit

* Add basic folder structure

* Add backend build system

* Added Basic Frontend implementation

* Backend: Work on grammar a bit

* Backend: Add basic Model abstraction

* Added Upvote Downvote and React Router

* Deleted redundant files

* Topic Create

* Added Answer creation ui. No functionality

* Backend: Get started on VM

* Backend: Create separate folder for webserver

* Changed Structure to match projects

* Lang: Work on VM

* Changed ModelPost and ModelComment to fit JSON-Data-Model

* Backend: Create common CommentBase class

* Backend: Make VM capable of evaluating a simple program

This patch also fixes a few bugs

* Backend: Allow function calls in expressions

* Backend: Add parenthesis support

* Backend: Implement if-statements

* Backend: Add arrays

* Bugfixes and Added API create_topic and create_comment

* Added better page jumping

* Backend: Implement new comment-based variable system

* Woraround for state in React

* Backend: Get some work on comment swapping done

* First swap impl

* Added Websockets to get live updates

* Backend: Implement move left

* Bug fixes in Swap Full

* Backend: Add notifyChange

* Added Load

* Added load and save to Model constructor and NotifyHandler

* Backend: Make VM async & fix many related bugs

* Added Save and delete

* Add getUpvotes and == and !=

* Added swap for ModelProvider

* Fixes Upvotes and Delete

* Some more cleanup and bugfixes

* First readme

* Added more text xD

* Removed error message on non existing file

* Added NPM install and added swapContent

* Changes!

* state

* complex example

* Work on README.md

Co-authored-by: VayuDev <vayudev@protonmail.com>
e89845d

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Auskommentiert (German for commented out)

Auskommentiert is a language based on comments in a format, that can be found on pages like Reddit. You can create a Topic (a Program if you want), and can comment on the Topic. On every comment, you can leave your answers as another comment.

This was originally intended as a Reddit bot, but the rules of the langjam state that the language must be easy to install, which would have been impossible because of API keys etc. This is why we made our own tiny Reddit clone.

You can swap comments, change the content of comments and store data in form of comments.

Execution

First, you have to install npm.

In order do execute the language interpreter, you have to do the following:

  1. Go to Auskommentiert/Backend and run npm install && npm run start_webserver
  2. Open another Terminal
  3. Go to Auskommentiert/Frontend and npm install && npm start

After you have installed all dependencies and started the server, you can pick one topic in the frontend. You may find some example Topics. If you want to create your own, simply click on Create Topic. Sadly, you cannot edit your comments after creation, so be aware of what you are typing. You can however delete comments and write them again.

Everything you do (including program execution) will get written to state.json. If you want to store you current state before execution, consider creating a copy of state.json.

In order to execute a topic, comment run directly under the topic body.

One thing to be aware of is: you can see all modifications on comments live. Meaning, your program will execute very slowly.

Grammar

All code and data is inside comments. There are no variables, instead you just use a comment field of your liking and refer to it's contents relative to the current comment. If a comment contains non-valid data, it is only an error if the comment gets executed.

Important are the comment getters; a comment getter is an expression that returns one or an array of comments. Examples:

  • {get 2 comments above 1 up} returns an array with the two comments above the current one
  • {get comment} returns the current comment
  • {get comment 1 left 2 up 1 down} gets the comment you get when navigating one left, then two up and then 1 down

Operators are mostly normal, the only special operator is $: it evalutes the comment after it, so ${get comment} is an endless loop. If you stored a number two comments above, you can get it with ${get comment 2 up}

There are a few basics comment types:

  • swap expression
    • expression must return an array of two WrappedComments which are then swapped
  • set targetExpression to valueExpression
    • Sets the content of targetExpression to valueExpression; valueExpression is turned into a string; this is basically self-modifying code
    • Example: set {get comment} to 'log(5)'; upon executing this statement the next time, it will log 5
  • move targetExpression navigation
    • Moves all comments specified by targetExpression using the navigation directions.
    • Example: move {get comment} 1 left; moves the current comment one to the left; this is the only direction that's currently implemented
  • if expression:
    • Only evaluates the children of this comment if the expression is true; remember the :
  • while expression:
    • Evaluates all children in a loop while expression is true; remember the :

Because the language is self-modifying, the code you've written might get overwritten after running it!